home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 76 / DVD Actual 1 Marzo 2003.iso / Trial / TurboCAD 7.1 Pro / Data.Cab / F29376_CamModule.bas < prev    next >
Encoding:
BASIC Source File  |  2000-11-10  |  8.6 KB  |  394 lines

  1. Attribute VB_Name = "Camera22"
  2. Option Explicit
  3. Public Sub Camera_Plan(TheView As View)
  4.     If (TheView.SpaceMode = imsiPaperSpace) Then
  5.         MsgBox "Camera's properties can be changed only in model space"
  6.         Exit Sub
  7.         'Camera's properties can be changed only in model space
  8.     End If
  9.     Dim Cam1 As XCamera
  10.     Dim Vpos As XVertex
  11.     Dim VLookAt As Vertex
  12.     Dim VerUp As Vertex
  13.  
  14.     Set Cam1 = TheView.Camera
  15.     Set Vpos = New XVertex
  16.     Set VLookAt = Vpos.Duplicate
  17.     Set VerUp = Vpos.Duplicate
  18.     
  19.     Vpos.X = 0
  20.     Vpos.Y = 0
  21.     Vpos.Z = 1
  22.     
  23.     VLookAt.X = 0
  24.     VLookAt.Y = 0
  25.     VLookAt.Z = 0
  26.     
  27.     VerUp.X = 0
  28.     VerUp.Y = 1
  29.     VerUp.Z = 0
  30.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  31.     TheView.Refresh
  32.     TheView.ZoomToExtents
  33.     TheView.Update = False
  34. Set VerUp = Nothing
  35. Set Vpos = Nothing
  36. Set VLookAt = Nothing
  37. Set Cam1 = Nothing
  38.  
  39. End Sub
  40. Public Sub Camera_Right(TheView As View)
  41.     If (TheView.SpaceMode = imsiPaperSpace) Then
  42.         MsgBox "Camera's properties can be changed only in model space"
  43.         Exit Sub
  44.         'Camera's properties can be changed only in model space
  45.     End If
  46.     Dim Cam1 As XCamera
  47.     Dim Vpos As XVertex
  48.     Dim VLookAt As Vertex
  49.     Dim VerUp As Vertex
  50.     
  51.     Set Cam1 = TheView.Camera
  52.     Set Vpos = New XVertex
  53.     Set VLookAt = Vpos.Duplicate
  54.     Set VerUp = Vpos.Duplicate
  55.     
  56.     Vpos.X = 1
  57.     Vpos.Y = 0
  58.     Vpos.Z = 0
  59.     
  60.     VLookAt.X = 0
  61.     VLookAt.Y = 0
  62.     VLookAt.Z = 0
  63.     
  64.     VerUp.X = 0
  65.     VerUp.Y = 0
  66.     VerUp.Z = 1
  67.     
  68.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  69.     TheView.ZoomToExtents
  70.     TheView.Refresh
  71.     
  72. Set VerUp = Nothing
  73. Set Vpos = Nothing
  74. Set VLookAt = Nothing
  75. Set Cam1 = Nothing
  76.  
  77. End Sub
  78.  
  79.  
  80. Public Sub Camera_Left(TheView As View)
  81.   If (TheView.SpaceMode = imsiPaperSpace) Then
  82.         MsgBox "Camera's properties can be changed only in model space"
  83.         Exit Sub
  84.         'Camera's properties can be changed only in model space
  85.   End If
  86.     Dim Cam1 As XCamera
  87.     Dim Vpos As XVertex
  88.     Dim VLookAt As Vertex
  89.     Dim VerUp As Vertex
  90.     
  91.     Set Cam1 = TheView.Camera
  92.     Set Vpos = New XVertex
  93.     Set VLookAt = Vpos.Duplicate
  94.     Set VerUp = Vpos.Duplicate
  95.     
  96.     Vpos.X = -1
  97.     Vpos.Y = 0
  98.     Vpos.Z = 0
  99.     
  100.     VLookAt.X = 0
  101.     VLookAt.Y = 0
  102.     VLookAt.Z = 0
  103.     
  104.     VerUp.X = 0
  105.     VerUp.Y = 0
  106.     VerUp.Z = 1
  107.     
  108.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  109.     TheView.ZoomToExtents
  110.     TheView.Refresh
  111.     
  112. Set VerUp = Nothing
  113. Set Vpos = Nothing
  114. Set VLookAt = Nothing
  115. Set Cam1 = Nothing
  116.  
  117. End Sub
  118.  
  119. Public Sub Camera_Front(TheView As View)
  120.   If (TheView.SpaceMode = imsiPaperSpace) Then
  121.         MsgBox "Camera's properties can be changed only in model space"
  122.         Exit Sub
  123.         'Camera's properties can be changed only in model space
  124.   End If
  125.     Dim Cam1 As XCamera
  126.     Dim Vpos As XVertex
  127.     Dim VLookAt As Vertex
  128.     Dim VerUp As Vertex
  129.     
  130.     Set Cam1 = TheView.Camera
  131.     Set Vpos = New XVertex
  132.     Set VLookAt = Vpos.Duplicate
  133.     Set VerUp = Vpos.Duplicate
  134.     
  135.     Vpos.X = 0
  136.     Vpos.Y = -1
  137.     Vpos.Z = 0
  138.     
  139.     VLookAt.X = 0
  140.     VLookAt.Y = 0
  141.     VLookAt.Z = 0
  142.     
  143.     VerUp.X = 0
  144.     VerUp.Y = 0
  145.     VerUp.Z = 1
  146.     
  147.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  148.     TheView.ZoomToExtents
  149.     TheView.Refresh
  150.     
  151. Set VerUp = Nothing
  152. Set Vpos = Nothing
  153. Set VLookAt = Nothing
  154. Set Cam1 = Nothing
  155.  
  156. End Sub
  157.  
  158.  
  159. Public Sub Camera_Back(TheView As View)
  160.   If (TheView.SpaceMode = imsiPaperSpace) Then
  161.         MsgBox "Camera's properties can be changed only in model space"
  162.         Exit Sub
  163.         'Camera's properties can be changed only in model space
  164.   End If
  165.     Dim Cam1 As XCamera
  166.     Dim Vpos As XVertex
  167.     Dim VLookAt As Vertex
  168.     Dim VerUp As Vertex
  169.     
  170.     Set Cam1 = TheView.Camera
  171.     Set Vpos = New XVertex
  172.     Set VLookAt = Vpos.Duplicate
  173.     Set VerUp = Vpos.Duplicate
  174.     
  175.     Vpos.X = 0
  176.     Vpos.Y = 1
  177.     Vpos.Z = 0
  178.     
  179.     VLookAt.X = 0
  180.     VLookAt.Y = 0
  181.     VLookAt.Z = 0
  182.     
  183.     VerUp.X = 0
  184.     VerUp.Y = 0
  185.     VerUp.Z = 1
  186.     
  187.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  188.     TheView.ZoomToExtents
  189.     TheView.Refresh
  190.     
  191. Set VerUp = Nothing
  192. Set Vpos = Nothing
  193. Set VLookAt = Nothing
  194. Set Cam1 = Nothing
  195.  
  196. End Sub
  197.  
  198. Public Sub Camera_Bottom(TheView)
  199.   If (TheView.SpaceMode = imsiPaperSpace) Then
  200.         MsgBox "Camera's properties can be changed only in model space"
  201.         Exit Sub
  202.         'Camera's properties can be changed only in model space
  203.   End If
  204.     Dim Cam1 As XCamera
  205.     Dim Vpos As XVertex
  206.     Dim VLookAt As Vertex
  207.     Dim VerUp As Vertex
  208.     
  209.     Set Cam1 = TheView.Camera
  210.     Set Vpos = New XVertex
  211.     Set VLookAt = Vpos.Duplicate
  212.     Set VerUp = Vpos.Duplicate
  213.     
  214.     Vpos.X = 0
  215.     Vpos.Y = 0
  216.     Vpos.Z = 1 '-1
  217.     
  218.     VLookAt.X = 0
  219.     VLookAt.Y = 0
  220.     VLookAt.Z = 0
  221.     
  222.     VerUp.X = 0
  223.     VerUp.Y = -1 '1
  224.     VerUp.Z = 0
  225.     
  226.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  227.     TheView.ZoomToExtents
  228.     TheView.Refresh
  229.     
  230. Set VerUp = Nothing
  231. Set Vpos = Nothing
  232. Set VLookAt = Nothing
  233. Set Cam1 = Nothing
  234.  
  235. End Sub
  236. Public Sub Camera_ISO_SE(TheView As View)
  237.   If (TheView.SpaceMode = imsiPaperSpace) Then
  238.         MsgBox "Camera's properties can be changed only in model space"
  239.         Exit Sub
  240.         'Camera's properties can be changed only in model space
  241.   End If
  242.     Dim Cam1 As XCamera
  243.     Dim Vpos As XVertex
  244.     Dim VLookAt As Vertex
  245.     Dim VerUp As Vertex
  246.     
  247.     Set Cam1 = TheView.Camera
  248.     Set Vpos = New XVertex
  249.     Set VLookAt = Vpos.Duplicate
  250.     Set VerUp = Vpos.Duplicate
  251.     
  252.     Vpos.X = 1
  253.     Vpos.Y = -1
  254.     Vpos.Z = 1
  255.     
  256.     VLookAt.X = 0
  257.     VLookAt.Y = 0
  258.     VLookAt.Z = 0
  259.     
  260.     VerUp.X = 0
  261.     VerUp.Y = 0
  262.     VerUp.Z = 1
  263.     
  264.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  265.     TheView.ZoomToExtents
  266.     TheView.Refresh
  267.     
  268. Set VerUp = Nothing
  269. Set Vpos = Nothing
  270. Set VLookAt = Nothing
  271. Set Cam1 = Nothing
  272.  
  273. End Sub
  274.  
  275. Public Sub Camera_ISO_NE(TheView As View)
  276.   If (TheView.SpaceMode = imsiPaperSpace) Then
  277.         MsgBox "Camera's properties can be changed only in model space"
  278.         Exit Sub
  279.         'Camera's properties can be changed only in model space
  280.   End If
  281.     Dim Cam1 As XCamera
  282.     Dim Vpos As XVertex
  283.     Dim VLookAt As Vertex
  284.     Dim VerUp As Vertex
  285.     
  286.     Set Cam1 = TheView.Camera
  287.     Set Vpos = New XVertex
  288.     Set VLookAt = Vpos.Duplicate
  289.     Set VerUp = Vpos.Duplicate
  290.     
  291.     Vpos.X = 1
  292.     Vpos.Y = 1
  293.     Vpos.Z = 1
  294.     
  295.     VLookAt.X = 0
  296.     VLookAt.Y = 0
  297.     VLookAt.Z = 0
  298.     
  299.     VerUp.X = 0
  300.     VerUp.Y = 0
  301.     VerUp.Z = 1
  302.     
  303.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  304.     TheView.ZoomToExtents
  305.     TheView.Refresh
  306.     
  307. Set VerUp = Nothing
  308. Set Vpos = Nothing
  309. Set VLookAt = Nothing
  310. Set Cam1 = Nothing
  311.  
  312. End Sub
  313.  
  314.  
  315. Public Sub Camera_ISO_SW(TheView As View)
  316.   If (TheView.SpaceMode = imsiPaperSpace) Then
  317.         MsgBox "Camera's properties can be changed only in model space"
  318.         Exit Sub
  319.         'Camera's properties can be changed only in model space
  320.   End If
  321.     Dim Cam1 As XCamera
  322.     Dim Vpos As XVertex
  323.     Dim VLookAt As Vertex
  324.     Dim VerUp As Vertex
  325.     
  326.     Set Cam1 = TheView.Camera
  327.     Set Vpos = New XVertex
  328.     Set VLookAt = Vpos.Duplicate
  329.     Set VerUp = Vpos.Duplicate
  330.     
  331.     Vpos.X = -1
  332.     Vpos.Y = -1
  333.     Vpos.Z = 1
  334.     
  335.     VLookAt.X = 0
  336.     VLookAt.Y = 0
  337.     VLookAt.Z = 0
  338.     
  339.     VerUp.X = 0
  340.     VerUp.Y = 0
  341.     VerUp.Z = 1
  342.     
  343.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  344.     TheView.ZoomToExtents
  345.     TheView.Refresh
  346.     
  347. Set VerUp = Nothing
  348. Set Vpos = Nothing
  349. Set VLookAt = Nothing
  350. Set Cam1 = Nothing
  351.  
  352. End Sub
  353.  
  354.  
  355. Public Sub Camera_ISO_NW(TheView As View)
  356.   If (TheView.SpaceMode = imsiPaperSpace) Then
  357.         MsgBox "Camera's properties can be changed only in model space"
  358.         Exit Sub
  359.         'Camera's properties can be changed only in model space
  360.   End If
  361.     Dim Cam1 As XCamera
  362.     Dim Vpos As XVertex
  363.     Dim VLookAt As Vertex
  364.     Dim VerUp As Vertex
  365.     
  366.     Set Cam1 = TheView.Camera
  367.     
  368.     Set Vpos = New XVertex
  369.     Set VLookAt = Vpos.Duplicate
  370.     Set VerUp = Vpos.Duplicate
  371.     
  372.     Vpos.X = -1
  373.     Vpos.Y = 1
  374.     Vpos.Z = 1
  375.     
  376.     VLookAt.X = 0
  377.     VLookAt.Y = 0
  378.     VLookAt.Z = 0
  379.     
  380.     VerUp.X = 0
  381.     VerUp.Y = 0
  382.     VerUp.Z = 1
  383.     
  384.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  385.     TheView.ZoomToExtents
  386.     TheView.Refresh
  387.     
  388. Set VerUp = Nothing
  389. Set Vpos = Nothing
  390. Set VLookAt = Nothing
  391. Set Cam1 = Nothing
  392. End Sub
  393.  
  394.